namespace System.Drawing
{
    using System;
    using System.Collections.Generic;

    internal class SystemBrushes
    {
        private static Dictionary<Color, Brush> _brushes = new Dictionary<Color, Brush>();

        private static Brush GetBrush(Color color)
        {
            if (!_brushes.ContainsKey(color))
            {
                _brushes.Add(color, new SolidBrush(color));
            }
            return _brushes[color];
        }

        internal static Brush Control
        {
            get
            {
                return GetBrush(SystemColors.Control);
            }
        }

        internal static Brush ControlDark
        {
            get
            {
                return GetBrush(SystemColors.ControlDark);
            }
        }

        internal static Brush ControlDarkDark
        {
            get
            {
                return GetBrush(SystemColors.ControlDarkDark);
            }
        }

        internal static Brush ControlLightLight
        {
            get
            {
                return GetBrush(SystemColors.ControlLightLight);
            }
        }

        internal static Brush Window
        {
            get
            {
                return GetBrush(SystemColors.Window);
            }
        }

        internal static Brush WindowText
        {
            get
            {
                return GetBrush(SystemColors.WindowText);
            }
        }
    }
}

